package common.server.feign;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.LoggerFactory;

/**
 * @Title: BaseRequestInterceptor
 * @ProjectName com-bigwavn-group
 * @Description: Feign 请求拦截器
 * @author: wangweitao 1749343503@qq.com
 * @date: 2019/6/4 16:21
 * @version: V1.0.0
 */
public class BaseRequestInterceptor implements RequestInterceptor {
    private static final org.slf4j.Logger logger = LoggerFactory
            .getLogger(FeignClientDefaultConfiguration.class);
    @Override
    public void apply(RequestTemplate requestTemplate) {
        requestTemplate.header("Content-Type","application/json");
        //对Feign http请求拦截
        logger.debug("FeignClient - Http:" + requestTemplate.request());
    }
}
